package com.itheima.controller;

import com.itheima.dto.PageBean;
import com.itheima.pojo.OperateLog;
import com.itheima.service.LogService;
import com.itheima.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
@Slf4j
public class LogController {

    @Autowired
    private LogService logService;

    @RequestMapping("/page")
    public Result<PageBean> page(Integer page,Integer pageSize) {
        log.info("接收到当前页码{},当前分页参数{}",page,pageSize);
        PageBean<OperateLog> pageBean=logService.page(page,pageSize);
        return Result.success(pageBean);
    }
}
